<html>
<head>
<link href="../../../Objects/sofa_white.css" rel="stylesheet" type="text/css" />
</head>
<body>
	<div id="contenu">
		
		<center><h3>Simple Shader (6/7)</h3>
		  <br><br>
		  <img src="5_Visual.png" name="Visu_start" align="middle" width=300>
		</center>

		
		<br><div id="orangeText">Description:</div>

        <p>The final tweak we will explore in visualizing is the use of <strong>Shaders</strong>, and other ways to replace OpenGL standard operations. We will add our own operation, using three different parts in the rendering pipeline.</p>

		<div id="orangeText">Key points</div>
		
        <div id="tutorialAction"><p>Clear the scene graph. Add a dragon <strong>OglModel</strong> as we did in the previous steps.</p></div>
        
        <p><strong>Shaders</strong> are applied in SOFA with the <strong>OglShader</strong> component. It will apply shading to all the Visual Models (<strong>OglModels</strong>) in its node, and all its child nodes. That way, you can have several Shaders in your scene.</p>
        
        <div id="tutorialAction"><p>Add an <strong>OlgShader</strong> component.</p></div>
        
		<p>The mandatory parameters are <i>vertFilename</i> and <i>fragFilename</i> where you give the path to the vertex and fragment GLSL code.</p>		


		<div id="tutorialAction"> <p> Using the file browser, set the <strong>vertFilename</strong> to <strong>/Sofa/share/shaders/phong.vert</strong>, and the <strong>fragFilename</strong> to <strong>/Sofa/share/shaders/phong.frag</strong>.</p>
         
        <p>Run in SOFA.</p></div>

        <br><center><h3><a href="6_Visual.scn">Next</a></center></h3>
	</div>
</body>
</html>
